import request from '@/utils/request'

// 查询keys值列表
export function getListKey(query) {
  return request({
    url: '/system/redis/key/list',
    method: 'get',
    params: query
  })
}

// 新增keys
export function addKey(data){
  return request({
    url: '/system/redis/key',
    method: 'post',
    data: data
  })
}

// 删除key信息
export function delKey(data) {
  return request({
    url: '/system/redis/key',
    method: 'delete',
    data: data
  })
}

// 删除all keys
export function delAllKeys(data) {
  return request({
    url: '/system/redis/key/all',
    method: 'delete',
    data: data
  })
}

// 模糊删除Key
export function delVagueKeys(query) {
  return request({
    url: '/system/redis/key/pattern',
    method: 'delete',
    params: query
  })
}

// key值rename
export function renameKey(data){
  return request({
    url: '/system/redis/key/rename',
    method: 'post',
    data: data
  })
}

// 超时时间修改
export function updateTtl(data){
  return request({
    url: '/system/redis/key/ttl',
    method: 'post',
    data: data
  })
}
